package cc.shacocloud.luanniao.core.utils

/**
 * 格式化字符串，使用指定包裹符进行替换
 *
 * @author 思追(shaco)
 */
fun String.messageFormat(
    params: Map<String, String>,
    prefixWrappers: String = "{",
    suffixWrappers: String = "}",
): String {
    var self = this
    for ((key, value) in params) {
        self = self.replace("$prefixWrappers$key$suffixWrappers", value)
    }
    return self
}